/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    TouchableOpacity,
    WebView,
    InteractionManager
} from 'react-native';
import GCStyle from '../../../Model/Global/GCStyle';
import WebContainer from "../../../Model/Component/WebContainer";
import {connect} from "react-redux";
import {AboutUs} from "../../../Action/UserAction";
class AboutUsMerchants extends Component {
    constructor(props) {
        super(props);

    }

    componentDidMount() {
        InteractionManager.runAfterInteractions(() => {
            const {dispatch} = this.props;
            dispatch(AboutUs());
        });
    }
    onClickBack() {
        const {navigator} = this.props;
        if (navigator) {
            navigator.pop();
        }
    }
    render() {
        const {UserReducer} = this.props;
        return (
            <View style={styles.container}>
                <View style={GCStyle.Style.navigatorView}>
                    <TouchableOpacity onPress={() => this.onClickBack(0)}>
                        <Image resizeMode='contain' source={require('../../../Resource/Imgs/nav_backoff.png')} style={GCStyle.Style.LeftBn}/>
                    </TouchableOpacity>
                    <Text style={GCStyle.Style.titleTxt}>关于我们</Text>
                    <Text style={GCStyle.Style.rightBn}/>
                </View>
                <WebContainer html={UserReducer.D_AboutUs}/>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: 'white'
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
});

export default connect((state) => {
    return {UserReducer} = state;
})(AboutUsMerchants);
